home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group96a.txt
/
000121_icon-group-sender _Wed May 29 23:07:51 1996.msg
< prev
next >
Wrap
Internet Message Format
|
1996-09-05
|
2KB
Received: by cheltenham.cs.arizona.edu; Thu, 30 May 1996 08:14:20 MST
Date: Wed, 29 May 1996 23:07:51 -0400 (EDT)
From: "Phillip L. Thomas" <ptho@loc.gov>
To: Stewart Midwinter <midtoad@cadvision.com>
Cc: icon-group@cs.arizona.edu
Subject: Re: 'Word wrap' utility
In-Reply-To: <4ne7tk$17vo@elmo.cadvision.com>
Message-Id: <Pine.A32.3.91.960529225759.52862E-100000@rs8.loc.gov>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Errors-To: icon-group-errors@cs.arizona.edu
Status: O
On 16 May 1996, Stewart Midwinter wrote:
...
>
> Often we receive mail messages, or FAQs, or other items that, when
> printed through a word processor or other program in proportional font
> instead of courier font, look terrible, since the lines are too short
> and of uneven length. The idea is to strip out all hard carriage
> returns within paragraphs, so that the full line length is used.
> Looks much nicer, but manually is not the way!
>
> The problem centers around how to tell what carriage returns to strip
> out:
The easiest solution in icon (or any other decent text language
like snobol4/spitbol) is to handle two lines at a time, beginning
with the first line set to "" and then read new lines into the
second line:
firstline := ""
while secondline := read() do {
# if secondline should not be appended to firstline
# then write the firstline and make firstline := ""
# if second line can be printed now, do it
# else firstline ||:= secondline
}
write(\firstline)
I'd write a procedure to determine the printability of the
second line and use in it icon's excellent matching and
addressing functions to code your conditions.
-- Phillip Lee Thomas
Library of Congress